﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucRegister.ascx.cs" Inherits="usercontrol_ucRegister" %>
<%@ Register Assembly="MSCaptcha" Namespace="MSCaptcha" TagPrefix="cc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<script type="text/javascript">
    function ValidateChecked(sender, args) {
        if ($('#<%= chkAccept.ClientID %>').attr('checked')) {
            $('#tdCheckboxAgree').removeClass("checkReq");
        }
        else {
            $('#tdCheckboxAgree').removeClass("checkReq");
            $('#tdCheckboxAgree').addClass("checkReq");
            args.IsValid = false;
        }
    }    
</script>

<style type="text/css">
    .checkReq
    {
        border: solid 1px Red;
        background-color: Yellow;
    }
</style>
<asp:UpdatePanel ID="panel1" runat="server">
    <ContentTemplate>
        <table id="content1" width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr id="tit1">
                <td height="30" class="btTitle" style="padding-left: 30px">
                    THÔNG TIN TÀI KHOẢN
                </td>
            </tr>
            <tr class="page_site">
                <td height="30" class="btTitle" style="padding-left: 30px">
                    Đăng ký
                </td>
            </tr>
            <tr>
                <td align="center">
                    <asp:Label ID="lblMessage" runat="server" Text="">
                    </asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Panel ID="pnlRegister" runat="server">
                        <table>
                            <tr>
                                <td style="padding: 5px 5px 10px 10px;" align="center">
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                        <tr>
                                            <td>
                                                <b>Đăng ký thành viên itoStore là miễn phí.</b>
                                                <br />
                                                <span style="color: Blue">Khi bạn đăng ký, bạn có thể sử dụng các chức năng quản ký người dùng của trang web
                                                để theo dõi các đơn đặt hàng của bạn cũng như xem lịch sử mua...</span>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td style="background-color: #e8e8e8">
                                    <b>&nbsp; Thông Tin Cá Nhân</b>
                                </td>
                            </tr>
                            <tr>
                                <td style="padding: 5px 7px 5px 15px; text-align: left;">
                                    <table border="0" cellpadding="0" cellspacing="3">
                                        <tr>
                                            <td align="right">
                                                Địa chỉ Email:
                                            </td>
                                            <td align="left">
                                                <asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server" TargetControlID="txtEmail"
                                                    WatermarkCssClass="clsWaterMarkRequiredField" WatermarkText="email@user.com">
                                                </asp:TextBoxWatermarkExtender>
                                                <asp:TextBox ID="txtEmail" runat="server" ValidationGroup="validRegister" ToolTip="Input email"
                                                    CssClass="txtRegisterReq"></asp:TextBox>
                                                &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtEmail"
                                                    runat="server" ErrorMessage="*" SetFocusOnError="True" Display="Static" ValidationGroup="grpRegister"></asp:RequiredFieldValidator>&nbsp;
                                                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="Invalid email address"
                                                    Display="Static" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                                    ControlToValidate="txtEmail" SetFocusOnError="True" ValidationGroup="grpRegister"></asp:RegularExpressionValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                Mật khẩu:
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" ToolTip="Input password"
                                                    CssClass="txtRegisterReq"></asp:TextBox>
                                                &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtPassword"
                                                    runat="server" ErrorMessage="*" Display="Static" ValidationGroup="grpRegister"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                Nhập lại mật khẩu:
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtRePassword" runat="server" TextMode="Password" ToolTip="Retype your password"
                                                    CssClass="txtRegisterReq"></asp:TextBox>
                                                &nbsp;<asp:RequiredFieldValidator ID="requireRePassword" ControlToValidate="txtRePassword"
                                                    runat="server" ErrorMessage="*" Display="Dynamic" ValidationGroup="grpRegister"></asp:RequiredFieldValidator>
                                                <asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="Passwords do not match. "
                                                    Display="Dynamic" ControlToCompare="txtPassword" ControlToValidate="txtRePassword"
                                                    ValidationGroup="grpRegister"></asp:CompareValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                Tên :
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtFName" runat="server" ValidationGroup="validRegister" CssClass="txtRegisterReq"></asp:TextBox>
                                                &nbsp;<asp:RequiredFieldValidator ID="requireFirstName" ControlToValidate="txtFName"
                                                    runat="server" ErrorMessage="*" Display="Dynamic" ValidationGroup="grpRegister"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" style="width: 230px;">
                                                Họ:
                                            </td>
                                            <td align="left">
                                                <asp:TextBox ID="txtSName" runat="server" ValidationGroup="validRegister" CssClass="txtRegisterReq"></asp:TextBox>
                                                &nbsp;<asp:RequiredFieldValidator ID="requireLastName" ControlToValidate="txtSName"
                                                    runat="server" ErrorMessage="*" Display="Dynamic" ValidationGroup="grpRegister"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td style="background-color: #e8e8e8">
                                    <b>&nbsp; Xác Minh</b>
                                </td>
                            </tr>
                            <tr>
                                <td align="center">
                                    <table border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td>
                                                <asp:UpdatePanel ID="updCap" runat="server">
                                                    <ContentTemplate>
                                                        <cc1:CaptchaControl ID="msCaptcha" runat="server" BorderWidth="1px" BorderStyle="Solid"
                                                            BorderColor="#5daeff" Width="185" FontColor="#007eb3" ForeColor="AliceBlue" NoiseColor="#237ceb"
                                                            CaptchaBackgroundNoise="Extreme" CaptchaLength="5" CaptchaHeight="50" CaptchaWidth="185"
                                                            CaptchaLineNoise="None" CaptchaMinTimeout="5" CaptchaMaxTimeout="240" LineColor="Yellow"
                                                            CaptchaFontWarping="Low" />
                                                    </ContentTemplate>
                                                </asp:UpdatePanel>
                                            </td>
                                            <td valign="top" style="padding-left: 5px;">
                                                <asp:Label ID="lblInputCaptcha" runat="server" Text="Mã xác nhận:" Style="font-size: 12px;"></asp:Label><asp:UpdatePanel
                                                    ID="updTxt" runat="server">
                                                    <ContentTemplate>
                                                        <asp:TextBox ID="txtCaptcha" runat="server" Width="100" CssClass="txtRegisterReq"
                                                            autocomplete="off" ToolTip="Mã xác minh"></asp:TextBox>&nbsp;<asp:RequiredFieldValidator
                                                                ID="regCaptcha" runat="server" ErrorMessage="" ToolTip="Nhap ma xác minh." ForeColor="Red"
                                                                ControlToValidate="txtCaptcha" SetFocusOnError="true" Text="*" ValidationGroup="grpRegister"></asp:RequiredFieldValidator></ContentTemplate>
                                                    <Triggers>
                                                        <asp:AsyncPostBackTrigger ControlID="lnkRefreshCaptcha" EventName="Click" />
                                                    </Triggers>
                                                </asp:UpdatePanel>
                                                <asp:LinkButton ID="lnkRefreshCaptcha" runat="server" Text="Cập nhật mã xác minh"
                                                    CausesValidation="false" Style="font-size: 12px;" OnClick="lnkRefreshCaptcha_Click"></asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td style="background-color: #e8e8e8">
                                    <b>&nbsp; Hiệp Định</b>
                                </td>
                            </tr>
                            <tr>
                                <td style="padding: 5px 7px 5px 7px; text-align: left;">
                                    <table border="0" cellpadding="0" cellspacing="3" width="100%">
                                        <tr>
                                            <td id="tdCheckboxAgree" class="loginLnk" style="text-align: center">
                                                <asp:CheckBox ID="chkAccept" runat="server" />
                                                Tôi chấp nhận
                                                <asp:HyperLink ID="lnkPolicy" runat="server" NavigateUrl="~/PrivacyPolicy .aspx">chính sách bảo mật</asp:HyperLink>
                                                <asp:CustomValidator ClientValidationFunction="ValidateChecked" runat="server" ID="valchkAccept"
                                                    ValidationGroup="grpRegister" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="text-align: center">
                                                <asp:CheckBox ID="chkNewsletter" runat="server" Checked="true" />
                                                Đăng ký bản tin trực tuyến trên iiStore.
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td align="center" style="padding-top: 10px;">
                                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                        <ContentTemplate>
                                            <asp:Button ID="btdangky" runat="server" Text="Đăng ký" OnClick="btdangky_Click"
                                                ValidationGroup="grpRegister" />
                                        </ContentTemplate>
                                        <Triggers>
                                            <asp:AsyncPostBackTrigger ControlID="btdangky" EventName="Click" />
                                        </Triggers>
                                    </asp:UpdatePanel>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td align="center" style="padding-top: 5px;">
                    <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                        <ProgressTemplate>
                            <asp:Image ID="imgLoading" runat="server" ToolTip="Loading..." ImageUrl="~/images/loadingAnimation.gif"
                                Style="border-width: 0px;" Width="31px" />
                        </ProgressTemplate>
                    </asp:UpdateProgress>
                </td>
            </tr>
        </table>
    </ContentTemplate>
</asp:UpdatePanel>
